<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/mypage/public/common.jspf"%>
<!DOCTYPE html>
<html>
<head>
<link
	href="${pageContext.request.contextPath}/page/module/assets/plugins/DataTables/css/data-table.css"
	rel="stylesheet" />
<script type="text/javascript" src="${pageContext.request.contextPath}/page/third/ueditor/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/page/third/ueditor/utf8-jsp/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/page/third/ueditor/utf8-jsp/lang/zh-cn/zh-cn.js"></script>	
<title>博客管理-文章列表</title>
<style type="text/css">
.table-page {
	float: right;
	margin: 0 auto;
}

.pagination>li>a {
	font-size: 12px;
	font-family: 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.pagination>li>a:focus, .pagination>li>a:hover, .current {
	color: #fff !important;
	background: #242a30 !important;
	border-color: #d8dde1;
}

.btn-group-sm>.btn, .input-group-btn>.btn-sm {
	padding: 8px 10px !important;
}
.form-horizontal{
	padding:5px 90px 5px 30px;
}
.modal-dialog {
    width: 600px;
    margin: 50px auto !important;
}
.modal-footer {
    text-align: center !important;
}
.savebtn{
    background: #2d353c !important;
    border-color: #2d353c !important;
}
.table-responsive td>a{
    color: #2d353c !important;
    text-decoration: none;
}
</style>
<script type="text/javascript">
	function goPage(currentPage) {
		window.location.href = "${pageContext.request.contextPath}/goArticleList.do?pageNo="
				+ currentPage;
	}
	//ueditor编辑器
	var ue = UE.getEditor('editor', {   
	    autoHeightEnabled: false,   
	    autoFloatEnabled: false,
		toolbars: [[
		             'fullscreen','source', '|', 'undo', 'redo', '|',
		            'bold', 'italic', 'underline', 'fontborder', 'strikethrough',  'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
		            'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
		            'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
		            'directionalityltr', 'directionalityrtl', 'indent', '|',
		            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
		            'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
		            'simpleupload', 'insertimage', 'emotion',  'map', 'insertcode',  'pagebreak', 'template', 'background', '|',
		            'horizontal', 'date', 'time', 'spechars',   '|',
		            'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols',  '|',
		            'preview', 
		        ]]
	});
	UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
	UE.Editor.prototype.getActionUrl = function(action) {
	    if (action == "/uploadArticleImg") {
	        return "${pageContext.request.contextPath}/uploadArticleImg.do";
	    } else {
	        return this._bkGetActionUrl.call(this, action);
	    }
	}	
	//获取单条记录
	function searchArtInfo(articleid){
		var url="${pageContext.request.contextPath}/searchArticleInfo.do";
		$.ajax({
			url:url,
			dataType:'json',
			cache:false,
			data:{'articleid':articleid,t:(new Date()).getTime()},
			success:function(data){
				alert(data)
				$("#title").val(data.title);
				$("#keywords").val(data.keyword);
				$("#typeId").val(data.typeId);
				ue.setContent(data.content);
			}
		})
		$('#myModal').modal('show');

	}
	$(function(){
		$("#myModal").on("hidden.bs.model",function(e){$(this).removeData();});  
	})
</script>
</head>
<body>
							<div class="form-group">
								<label for="title" class="col-sm-3 control-label">标题：</label>
								<div class="col-sm-9">
									<input type="text" class="form-control" id="title"
										placeholder="请输入标题" name="title" value="">
								</div>
							</div>
							<div class="form-group">
								<label for="keywords" class="col-sm-3 control-label">关键字：</label>
								<div class="col-sm-9">
									<input type="text" class="form-control" id="keywords"
										placeholder="请输入关键字以，隔开" name="keyword" value="">
								</div>
							</div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">文章分类：</label>
                                <div class="col-sm-9">
                                    <select class="form-control" name="typeId">
                                    	<c:forEach items="${mblogType}" var="type">
                                    		<option value="${type.id}">${type.typename }</option>
                                    	</c:forEach>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">文章内容：</label>
                                <div class="col-sm-9">
 									<script id="editor" type="text/plain" style=" z-index:1000" name="content"></script>
                                </div>
                            </div>
		<!-- 结束主要内容 -->

		<script
			src="${pageContext.request.contextPath}/page/module/assets/plugins/DataTables/js/jquery.dataTables.js"></script>
		<script
			src="${pageContext.request.contextPath}/page/module/assets/js/table-manage-default.demo.min.js"></script>
		<script
			src="${pageContext.request.contextPath}/page/module/assets/js/apps.min.js"></script>
		<script>
			$(document).ready(function() {
				App.init();
				//TableManageDefault.init();
			});
		</script>
		<script>
			(function(i, s, o, g, r, a, m) {
				i['GoogleAnalyticsObject'] = r;
				i[r] = i[r] || function() {
					(i[r].q = i[r].q || []).push(arguments)
				}, i[r].l = 1 * new Date();
				a = s.createElement(o), m = s.getElementsByTagName(o)[0];
				a.async = 1;
				a.src = g;
				m.parentNode.insertBefore(a, m)
			})(window, document, 'script',
					'//www.google-analytics.com/analytics.js', 'ga');

			ga('create', 'UA-53034621-1', 'auto');
			ga('send', 'pageview');
		</script>
</body>
</html>

